/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.spring66.training.dao.hibernate;

import com.spring66.training.dao.PetDao;
import com.spring66.training.entity.Pet;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 *
 * @author TwinP
 */
public class PetDaoHibernate extends HibernateDaoSupport implements PetDao {

    @Override
    public void create(Pet pet) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Pet loadPet(Integer pk) {
        return (Pet)getHibernateTemplate().load(Pet.class, pk);
    }

    @Override
    public void update(Pet pet) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void delete(Pet pet) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<Pet> readAll() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void storePet(Pet pet) {
        getHibernateTemplate().saveOrUpdate(pet);
    }

}
